<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>正在学习:{{msg}}</h1>
        <button v-on:click="change()">切换</button>
    </div>
    
    <script src="plugins/vue2.js"></script>
    <script>
        new Vue({
            el:'#app',
            data:function(){
                return{
                    isJava:true,
                }
            },

            methods:{
                change(){
                    this.isJava = !this.isJava;
                }
            },

            computed:{
                msg(){
                    return this.isJava?'Java':'vue2'
                }
            }
        });
    </script>
</body>
</html>